﻿<UserControl xmlns:PageBar="clr-namespace:Mengsk.ProxyDelivery.App.UI.PageBar"  x:Class="Mengsk.ProxyDelivery.App.UI.Delivery.ArriveInQueryUserControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
               xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
             d:DesignHeight="300" d:DesignWidth="1200" Loaded="UserControl_Loaded">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <StackPanel Grid.Row="0" Orientation="Horizontal">
            <TextBlock Text="收件类型:" Margin="3" VerticalAlignment="Center"/>
            <ComboBox Name="cbbType" Margin="3" VerticalAlignment="Center" Width="60"/>
            <TextBlock Text="快递公司:" Margin="3" VerticalAlignment="Center"/>
            <ComboBox Name="cbbDeliveryCompany" Margin="3" VerticalAlignment="Center" Width="100"/>
            <TextBlock Text="快递单号:" Margin="3" VerticalAlignment="Center"/>
            <TextBox Name="tbDeliveryNumber" Margin="3" VerticalAlignment="Center" Width="100"/>
            <TextBlock Text="订单编号:" Margin="3" VerticalAlignment="Center"/>
            <TextBox Name="tbOrderId" Margin="3" VerticalAlignment="Center" Width="100"/>
            <TextBlock Grid.Row="1" Grid.Column="2" Text="开始时间:" Margin="3" VerticalAlignment="Center"/>
            <xctk:DateTimePicker xctk:Format="Custom" xctk:TimeFormatString="yyyy-MM-dd HH:mm:ss" Grid.Row="1" Grid.Column="3" Name="dpStart" Margin="3" VerticalAlignment="Center" MinWidth="140"/>
            <TextBlock Grid.Row="1" Grid.Column="4" Text="结束时间:" Margin="3" VerticalAlignment="Center"/>
            <xctk:DateTimePicker Grid.Row="1" xctk:Format="Custom"  xctk:TimeFormatString="yyyy-MM-dd HH:mm:ss" Grid.Column="5" Name="dpEnd" Margin="3" VerticalAlignment="Center" MinWidth="140"/>
            <Button Name="btnSearch" Content="查询" Margin="3" VerticalAlignment="Center" Width="60" Click="btnSearch_Click"/>
        </StackPanel>
        <DataGrid Grid.Row="1" AutoGenerateColumns="False" GridLinesVisibility="All" IsReadOnly="True" Name="dgvItems">
            <DataGrid.Columns>
                <DataGridTextColumn Header="收货编号" Binding="{Binding Id}"/>
                <DataGridTextColumn Header="类型" Binding="{Binding ArriveReason,Converter={StaticResource descriptionConverter}}"/>
                <DataGridTextColumn Header="订单编号" Binding="{Binding OrderId}"/>
                <DataGridTextColumn Header="子订单编号" Binding="{Binding OrderGoodsId}"/>
                <DataGridTextColumn Header="退货编号" Binding="{Binding OrderChangeId}"/>
                <DataGridTextColumn Header="快递公司" Binding="{Binding DeliveryCompany}"/>
                <DataGridTextColumn Header="快递单号" Binding="{Binding DeliveryNumber}"/>
                <DataGridTextColumn Header="接收时间" Binding="{Binding CreateTime,Converter={StaticResource datetimeConverter}}"/>
                <DataGridTextColumn Header="商品信息" Binding="{Binding GoodsInfo}"/>
                <DataGridTextColumn Header="描述" Binding="{Binding Comment}"/>
            </DataGrid.Columns>
        </DataGrid>
        <PageBar:PageBarUserControl Grid.Row="2" x:Name="pgBar" PageSize="200" PageChanging="pgBar_PageChanging"/>
    </Grid>
</UserControl>
